<template>
	<!--
    	作者：1550495493@qq.com
    	时间：2019-08-13
    	描述：项目管理员-结题报告
    -->
	<div class="HomePage">
		<div class="location">
			<div class="location-text fl">
				<img class="location-img fl" src="../../images/ProjectManager/conclusion.png" />
				<p class="fr">结题报告</p>
			</div>
			<img class="biaotibg fl" src="../../images/home/biaotibg.png" />
		</div>
		<div class="IssuedNotice-box">
			<div class="search-box">
	          <input name="search" class="search" id="searchRoleVal" autocomplete="off" type="text" v-model="search"/>
	          <input class="btn" type="button" value="搜索" @click="searchTodo"/>
			</div>
		</div>
		<div class="PressRelease-list">
			<table>
				<thead>
					<tr>
						<th class="w200">项目名称</th>
						<th class="w100"> 合同开始时间 </th>
						<th class="w100">合同结束时间</th>
						<th class="w80">项目类型</th>
						<th class="w80">结题报告 </th>
						<th class="w80">评审</th>
						<th class="w80">评审结果</th>
			            <th class="w80">审核状态</th>
			            <th class="w80">项目状态</th>
						<th class="w200">操作</th>
						<th class="w100">上传科研系统</th>
					</tr>
				</thead>
				<tbody>
          <tr v-if="projectList.length == 0">
            <td colspan="11" class="center">暂无数据！</td>
          </tr>
          <tr v-for="(project,index) in projectList" :class="index==curIndex?'activeBg':''" @click="choosed(index)">
						<td :title="project.name"><span class="show-twoline">{{project.name}}</span></td>
						<td>{{formatData(project.contractBeginTime)}}</td>
						<td>{{formatData(project.contractEndTime)}}</td>
						<td>{{project.type == 1 ? "横向项目" : "研究院项目"}}</td>
						<td><input type="button" value="查看" class="delete write" @click="preview(project.closureMaterialUrl)"/></td>
						<td>
              <input @click="demand(project.id)" type="button" value="组织评审" class="delete write" v-if="project.closureAuditStatus == 1 && project.rectificationedStatus == 0 && project.areasStatus != 6 && project.areasStatus != 3 && (project.reviewStatus == null || project.reviewStatus == 0)"/>
              <!--<input type="button" value="提醒专家" class="delete" />-->
            </td>
						<td><input @click="AllTickets(project.id)" type="button" value="查看" class="delete write" /></td>
            <td>
              <!--暂时开放时间未结束可以审核
              <template v-if="project.optionStatus == 0">
                待审核
              </template>
              <template v-else>
                {{auditStatus(project.closureAuditStatus)}}
              </template>-->
              <template v-if="project.closureAuditStatus == 1">
                待审核
              </template>
              <template v-else-if="project.closureAuditStatus == 2">
                结题成功
              </template>
              <template v-else-if="project.closureAuditStatus == 3">
                结题失败
              </template>
              <template v-else-if="project.closureAuditStatus == 4">
                限期整改
              </template>
              <!--{{auditStatus(project.closureAuditStatus)}}-->
            </td>
            <td>{{project.areasStatus == 6 || project.areasStatus == 3 ? "无效" : "有效"}}</td>
						<td>
              <!--暂时开放时间未结束可以审核
              <template v-if="project.closureAuditStatus == 1 && project.optionStatus == 1">-->
              <template v-if="(project.closureAuditStatus == 1 || project.closureAuditStatus == 4) && (project.areasStatus == 6 || project.areasStatus == 3 ? false : true)">
                <input type="button" value="通过" class="through" @click="auditProject(project.id,2)"/>|
                <input type="button" class="through" value="不通过" @click="auditModelShow(project.id)"/>
                <template v-if="project.rectificationedStatus == 0">
                  |
                  <input type="button" class="through" value="限期整改" @click="SpecialistBtn(project.id)"/>
                </template>
              </template>
						</td>
						<td><input type="button" value="提交" class="delete write" /></td>
					</tr>
				</tbody>
			</table>

		</div>
		<!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
			<pageination :total="total" :size="size" :page="page" :changge="pageFn" @child="obtainChild"></pageination>
		<!-- 评审组织-模态框-->
		<!--<div v-show="demandModelShow" class="tenant-model">
			<div class="tenant-model-content demandModel">
				<header class="tenant-model-header">
					<h3>评审组织</h3>
					<span @click="closeModel" class="closeModel">×</span>
				</header>
				<div class="tenant-model-body">
					<div class="search-contain">
						&lt;!&ndash;模态框内容板块&ndash;&gt;
						<div v-if="reviewTable" class="review-table">
							<div class="review" style="height: 300px">
								<div class="search-box">
									<div class="fl">
										<select class="search" name="expertSearchType" v-model="expertSearchType">
											<option value="expertName">姓名</option>
                      <option value="theWork">身份证</option>
                      <option value="secondLevel">二级学科</option>
										</select>
                    <input name="expertSearchMsg" class="search" type="text" v-model="expertSearch"/>
                    <input class="btn" type="button" value="搜索" @click="searchAllNotApplicationExpertTodo"/>
									</div>
								</div>
								<table>
									<tr>
										<th>专家姓名</th>
										<th>身份证号</th>
										<th>二级学科</th>
										<th>专业技术职务</th>
										<th>操作</th>
									</tr>
                  <tr v-for="notApplyExpert in notApplyExpertList">
                    <td>{{notApplyExpert.expertName}}</td>
                    <td>{{notApplyExpert.expertTheWork}}</td>
                    <td>{{notApplyExpert.expertSecondLevel}}</td>
                    <td>{{notApplyExpert.expertProfessionalSkillDuty}}</td>
                    <td><input type="button" value="选择" class="delete write" @click="addReviewExpert(notApplyExpert)"/></td>
                  </tr>
								</table>
                &lt;!&ndash;total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  &ndash;&gt;
                <pageination :total="notApplyExpertTotal" :size="notApplyExpertSize" :page="notApplyExpertPage" :changge="notApplyExpertPageFn" @child="obtainChild"></pageination>
              </div>
							<div class="Evaluation-experts">
								<p>评审专家</p>
								<table>
									<tr>
										<th>专家姓名</th>
										<th>身份证号</th>
										<th>二级学科</th>
										<th>专业技术职务</th>
										<th>操作</th>
									</tr>
                  <tr v-for="reviewExpert in reviewExpertList">
                    <td>{{reviewExpert.expertName}}</td>
                    <td>{{reviewExpert.expertTheWork}}</td>
                    <td>{{reviewExpert.expertSecondLevel}}</td>
                    <td>{{reviewExpert.expertProfessionalSkillDuty}}</td>
                    <td><input type="button" value="删除" class="delete write" @click="removeReviewExpert(reviewExpert)"/></td>
                  </tr>
								</table>
								<button @click="nextStep" class="btn">下一步</button>
							</div>
						</div>
						<div v-show="score" class="score">
							<div class="rork">
								<p>项目名称：{{projectInfo.name}}</p>
								<p>项目类型：{{projectInfo.type == 1 ? "横向项目" : "研究院项目"}}</p>
								<p>发起基地：{{projectInfo.areasName}}</p>
                <p>附件：<a href="urls.baseUrl + projectInfo.demandBookUrl" target="_blank" class="attachment" v-if="projectInfo.demandBookUrl != null && projectInfo.demandBookUrl != ''">需求说明书</a>
								</p>
							</div>
							<table>
								<tr>
									<th>专家姓名</th>
									<th>身份证号</th>
									<th>二级学科</th>
									<th>申请书</th>
								</tr>
                <tr v-for="applyExpert in applyExpertList">
                  <td>{{applyExpert.expertName}}</td>
                  <td>{{applyExpert.expertTheWork}}</td>
                  <td>{{applyExpert.expertSecondLevel}}</td>
                  <td><input type="button" value="查看" class="delete write" @click="preview(project.applicationBookUrl)"/></td>
                </tr>
							</table>
              <form class="form-box" id="reviewForm">
                <div class="search-boxs imgbox">
                  <label>评审标准上传：</label>
                  <input type="file" id="handIdFront" accept=".doc,.docx,.xls,.xlsx,.pdf,.html,.txt,image/jpeg,image/tif,image/gif,image/png,image/bmp,.mp3,.mp4,.wav,.flv,.avi" @change="idFrontImg($event)" style="display: none;" />
                  <input type="hidden" name="standardUrl" v-model="reviewerExpertTemp.standardUrl"/>
                  <a class="Public-btn1 uploadbtn handIdFrontA " @click="touchOffIdInput(1)">上传附件</a>
                  <ul class="img-box">
                    <li v-for="file in FileUpload">{{file}}</li>
                  </ul>
                </div>
                <div class="form-line">
                  <label>评审方式：</label>
                  <input name="type" class="btn" value="0" type="radio" v-model="reviewerExpertTemp.type"/>打分制
                  <input name="type" class="btn" value="1" type="radio" v-model="reviewerExpertTemp.type"/>评价制
                </div>
                <div class="form-line">
                  <label>评审截止时间：</label>
                  <el-date-picker
                    name="endTime"
                    v-model="reviewerExpertTemp.endTime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                </div>
                <input type="reset" name="reset" style="display: none;" />
              </form>
							<button class="save" @click="saveReviewerExpert">推送并通知大家</button>
						</div>
					</div>
				</div>
			</div>
		</div>-->

		<!-- 评审结果-模态框-->
    <div v-if="Tickets"  class="tenant-model">
      <div class="tenant-model-content tickets">
        <header class="tenant-model-header">
          <h3>评审结果</h3>
          <span @click="closeModel()" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--模态框内容板块-->
            <div  class="review-table">
              <label v-if="projectReviewResultList.length == 0">暂无评审信息</label>
              <div class="review" v-if="projectReviewResultList.length > 0">
              	<table>
					<thead>
						<tr>
							<th>排序</th>
							<th>申请专家</th>
							<th>评审专家</th>
							<th v-if="projectReviewResultList.length&&projectReviewResultList[0].type == 0">分数</th>
							<th v-if="projectReviewResultList.length&&projectReviewResultList[0].type == 0">合计</th>
							<th v-else>评价</th>
						</tr>
					</thead>

					<tbody v-for="(projectReviewResult,index) in projectReviewResultList">
						<tr v-for="(accreditationExpert,num) in projectReviewResult.reviewExpertNames">
							<td :rowspan="projectReviewResult.reviewExpertNames.length" v-if="!num">{{index + 1}}</td>
							<td :rowspan="projectReviewResult.reviewExpertNames.length" v-if="!num">{{projectReviewResult.applicationExpertName}}</td>
							<td>{{accreditationExpert}}</td>
							<!--打分-->
							<td v-if="projectReviewResult.type == 0">{{projectReviewResult.scores[num]?projectReviewResult.scores[num]:""}}</td>
							<!--通过/不通过-->
							<td v-else>{{projectReviewResult.audits[num]?projectReviewResult.audits[num]:""}}</td>
							<!--打分-->
							<td :rowspan="projectReviewResult.reviewExpertNames.length" v-if="!num&&projectReviewResult.type == 0">{{projectReviewResult.scoreCount}}</td>

						</tr>
					</tbody>
				</table>
               <!-- <table>
                  <tr>
                    <th>排序</th>
                    <th>申请专家</th>
                    <th v-for="reviewExpertName in projectReviewResultList[0].reviewExpertNames">{{reviewExpertName}}</th>
                    <template v-if="projectReviewResultList[0].type == 0">
                      <th>合计</th>
                    </template>
                  </tr>
                  <tr v-for="(projectReviewResult,index) in projectReviewResultList">
                    <td>{{index + 1}}</td>
                    <td>{{projectReviewResult.applicationExpertName}}</td>
                    <template v-if="projectReviewResult.type == 0">
                      <th v-for="score in projectReviewResult.scores">{{score}}</th>
                      <td>{{projectReviewResult.scoreCount}}</td>
                    </template>
                    <template v-else>
                      <th v-for="audit in projectReviewResult.audits">{{audit}}</th>
                    </template>
                  </tr>
                </table>-->
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!--组织审对话框-->
    <div id="organizationReviewDialog" v-show="organizationReviewDialogFlag" class="tenant-model">
      <div class="tenant-model-content">
        <header class="tenant-model-header">
          <h3>组织评审</h3>
          <span @click="closeModel(organizationReviewDialogFlag)" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain secondLevelPageination">
            <!--模态框内容板块-->
            <div class="review" style="height: 300px">
              <div class="search-box">
                <div class="fl">
                  <select class="search" v-model="expertSearchType">
                    <option value="expertName">姓名</option>
                    <option value="expertTheWork">身份证号</option>
                    <option value="expertSecondLevel">二级学科</option>
                  </select>
                  <input class="search" type="text" v-model="expertSearch"/>
                  <input class="btn" type="button" value="搜索" @click="searchAllNotApplicationExpertTodo"/>
                </div>
              </div>
              <table>
                <tr>
                  <th>专家姓名</th>
                  <th>身份证号</th>
                  <th>二级学科</th>
                  <th>专业技术职务</th>
                  <th>操作</th>
                </tr>
                <tr v-if="notApplyExpertList.length == 0">
                  <td colspan="5" class="center">暂无数据</td>
                </tr>
                <tr v-for="notApplyExpert in notApplyExpertList">
                  <td>{{notApplyExpert.expertName}}</td>
                  <td>{{notApplyExpert.expertTheWork}}</td>
                  <td>{{notApplyExpert.expertSecondLevel}}</td>
                  <td>{{notApplyExpert.expertProfessionalSkillDuty}}</td>
                  <td><input type="button" value="选择" class="delete write" @click="addReviewExpert(notApplyExpert)"/></td>
                </tr>
              </table>
              <!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
              <pageination :total="notApplyExpertTotal" :size="notApplyExpertSize" :page="notApplyExpertPage" :changge="notApplyExpertPageFn" @child="obtainChild"></pageination>
            </div>
            <div class="Evaluation-experts">
              <p>已选择评审专家</p>
              <table>
                <tr>
                  <th>专家姓名</th>
                  <th>身份证号</th>
                  <th>二级学科</th>
                  <th>专业技术职务</th>
                  <th>操作</th>
                </tr>
                <tr v-if="!reviewExpertList.length">
                  <td colspan="5" class="center">暂无数据</td>
                </tr>
                <tr v-for="reviewExpert in reviewExpertList">
                  <td>{{reviewExpert.expertName}}</td>
                  <td>{{reviewExpert.expertTheWork}}</td>
                  <td>{{reviewExpert.expertSecondLevel}}</td>
                  <td>{{reviewExpert.expertProfessionalSkillDuty}}</td>
                  <td><input type="button" value="删除" class="delete write" @click="removeReviewExpert(reviewExpert)"/></td>
                </tr>
              </table>
              <div class="center">
              	 <button @click="showOrganizationReviewNextDialog" class="btn">下一步</button>
              </div>

            </div>
          </div>
        </div>
      </div>
    </div>

    <!--组织审下一步对话框-->
    <div id="organizationReviewNextDialog" v-show="organizationReviewNextDialogFlag" class="tenant-model">
      <div class="tenant-model-content secondLevelPageination">
        <header class="tenant-model-header">
          <h3>组织评审</h3>
          <span @click="closeModel(organizationReviewNextDialogFlag)" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <div class="score">
              <div class="rork">
                <div>项目名称：<p>{{projectInfo.name}}</p></div>
                <p>项目类型：{{projectInfo.type == 1 ? "横向项目" : "研究院项目"}}</p>
                <div>发起基地：<p>{{projectInfo.areasName}}</p></div>
                <p>项目需求说明书：
                  <input type="button" value="预览" class="delete write" @click="preview(projectInfo.demandBookUrl)"/>
                </p>
              </div>
              <table>
                <tr>
                  <th>专家姓名</th>
                  <th>身份证号</th>
                  <th>二级学科</th>
                  <th>申请书</th>
                </tr>
                <tr v-if="applyExpertList.length == 0">
                  <td colspan="4" class="center">暂无数据！</td>
                </tr>
                <tr v-for="applyExpert in applyExpertList">
                  <td>{{applyExpert.expertName}}</td>
                  <td>{{applyExpert.expertTheWork}}</td>
                  <td>{{applyExpert.expertSecondLevel}}</td>
                  <td><input type="button" value="查看" class="delete write" @click="preview(applyExpert.applicationBookUrl)"/></td>
                </tr>
              </table>
              <!--total  数据总数   size  一页多少条数据   page  当前页码    changge 返回当前选择的页码  改变一页显示条 child  返回值就是一页显示条数  -->
              <pageination :total="applyExpertTotal" :size="applyExpertSize" :page="applyExpertPage" :changge="applyExpertPageFn" @child="obtainChild"></pageination>
              <form class="form-box" id="reviewForm">
                <div class="search-boxs input-required">
                  <label>评审标准上传：</label>
                  <input type="file" id="handIdFront" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg($event)" style="display: none;" />
                  <input type="hidden" name="standardUrl" v-model="reviewerExpertTemp.standardUrl"/>
                  <input type="button" value="上传附件" class="delete write" @click="touchOffIdInput(1)"/>
                  <input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"/>
                  <ul class="img-box">
                    <li v-for="file in FileUpload">{{file}}</li>
                  </ul>
                </div>
                <div class="form-line">
                  <label>评审方式：</label>
                  <label>
                  <input name="type" value="0" type="radio" v-model="reviewerExpertTemp.type" checked/>打分制
                  </label>
                  	<label>

                  <input name="type" value="1" type="radio" v-model="reviewerExpertTemp.type"/>评价制
                	</label>
                </div>
                <!--<div class="form-line">
                  <label>评审截止时间：</label>
                  <el-date-picker
                    name="endTime"
                    v-model="reviewerExpertTemp.endTime"
                    type="date"
                    placeholder="选择日期">
                  </el-date-picker>
                </div>-->
                <input type="reset" name="reset" style="display: none;" />
              </form>
              <div class="center">
              	<button class="save" @click="saveReviewerExpert">通知评审专家</button>
              </div>

            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- - 不通过 退出 模态框-->
    <div v-show="auditModel" class="tenant-model">
      <div class="tenant-model-content  disagree">
        <header class="tenant-model-header">
          <h3>审核不通过</h3>
          <span @click="closeModel()" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--		&lt;!&ndash;模态框内容板块&ndash;&gt;-->
            <form class="form-box">
            	<div class="msg">
                <label v-if="!auditObj.closureAuditMsg&&closureAuditMsg">请输入不通过原因</label>
                <label v-else-if="auditObj.closureAuditMsg!=null&&auditObj.closureAuditMsg.length > 100">原因最多只能输入100个字</label>
              </div>
              <div class="form-line input-required">
                <label class="textarea-label">原因：</label>
                <div class="input-box textarea-box">
                  <textarea name="screenAuditMsg" v-model="auditObj.closureAuditMsg"></textarea>
                </div>
              </div>

              <div class="form-line">
                <label class="textarea-label">附件：</label>
                <input name="closureAuditEnclosureUrl" type="hidden" v-model="auditObj.closureAuditEnclosureUrl"/>
                <input type="file" ref="uploadFile" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg2($event)" style="display: none;" />
                <input type="button" value="上传附件" class="delete write" @click="$refs.uploadFile.click()"/>
                <input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"/>
                <ul class="img-box">
                  <li v-for="item in FileUpload">{{item}}</li>
                </ul>
              </div>
            </form>
          </div>
        </div>
        <footer class="tenant-model-footer">
          <button class="determine" @click="auditData">确定</button>
        </footer>
      </div>
    </div>

    <!-- 限期整改-模态框  -->
    <div  v-show="Specialist" class="tenant-model">
      <div class="tenant-model-content rectification">
        <header class="tenant-model-header ">
          <h3>限期整改</h3>
          <span @click="closeModel()" class="closeModel">×</span>
        </header>
        <div class="tenant-model-body">
          <div class="search-contain">
            <!--模态框内容板块-->
            <div class="review-table">
              <div class="review">
                <form class="form-box" id="deadlineRectificationForm">
                  <div class="after">
                    <input name="id" type="hidden" :value="deadlineRectification.id"/>
                    <input type="reset" name="reset" style="display: none;" />
                    <div class="form-line input-required fl">
                      <label>开始时间：</label>
                      <el-date-picker name="deadlineBeginTime" v-model="deadlineRectification.deadlineBeginTime" @change="deadlineBeginTimeChange($event)" type="date" :picker-options="pickerOptions1" placeholder="选择日期">
                      </el-date-picker>
                    </div>
                    <div class="form-line input-required fl">
                      <label>结束时间：</label>
                      <el-date-picker name="deadlineEndTime" v-model="deadlineRectification.deadlineEndTime" @change="deadlineEndTime($event)" :picker-options="pickerOptions2" type="date" placeholder="选择日期">
                      </el-date-picker>
                    </div>

                  </div>
                  <div class="form-line input-required">
                    <label>整改内容：</label>
                    <textarea name="closureAuditMsg" v-model="deadlineRectification.closureAuditMsg"></textarea>
                  </div>
                  <div class="form-line">
                    <label class="textarea-label">附件：</label>
                    <input name="closureAuditEnclosureUrl" type="hidden" v-model="deadlineRectification.closureAuditEnclosureUrl"/>
                    <input type="file" ref="uploadFile" accept=".txt,.rar,.zip,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.exe,image/*" @change="idFrontImg2($event)" style="display: none;" />
                    <input type="button" value="上传附件" class="delete write" @click="$refs.uploadFile.click()"/>
                    <input type="button" value="删除附件" class="delete write" @click="deleteEnclosure()"/>
                    <ul class="img-box">
                      <li v-for="item in FileUpload">{{item}}</li>
                    </ul>
                  </div>
                  <!--<div class="form-line">
                                                          <label>共计：</label>
                                      <label>{{deadlineRectification.dayNum}}</label>
                                                          <span>天</span>
                                                      </div>-->

                  <div class="center">
                    <input class="save" @click="saveProjectDeadlineRectification" type="button" value="确定">
                  </div>
                </form>

              </div>
            </div>

          </div>
        </div>
      </div>
    </div>
	</div>
</template>
<script src="./TheConcludingReports.js"></script>

<style scoped>
	@import "TheConcludingReports.css"
</style>
